<div id="slider">
    <?php    foreach ($img as $key) {
        echo '<img src="/images/slider/'.$key->name_image.'" alt="" />';
    }

    ?>
</div>